package com.kucai.yifaqapp.ui.fragment.gameFragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.kucai.yifaqapp.R;
import com.kucai.yifaqapp.model.network.entity.res.z_moneyDetail;


/**
 * Created by admin on 2018/11/29.
 * 这是分享的diolog
 */

public class MoneydetailDialog extends Activity {
    private TextView textView1;
    private TextView textView2;
    private TextView textView3;
    private TextView textView4;
    private TextView textView5;
    private TextView textView6;
    private TextView textView7;
    private TextView textView8;
    private TextView textView9;
    private Button cancle;
    private Button conform;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pop_layout);
        getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        MoneydetailDialog.this.getWindow().setFlags(
                WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        textView1 = findViewById(R.id.text1);
        textView2 = findViewById(R.id.text2);
        textView3 = findViewById(R.id.text3);
        textView4 = findViewById(R.id.text4);
        textView5 = findViewById(R.id.text5);
        textView6 = findViewById(R.id.text6);
        textView7 = findViewById(R.id.text7);
        textView8 = findViewById(R.id.text8);
        textView9 = findViewById(R.id.text9);
        cancle = findViewById(R.id.btn_neg);
        conform = findViewById(R.id.btn_pos);
        /**
         * id : 163
         * orderNo : PAY2018112817343397506904
         * userName : zxcv
         * userId : 1165
         * statDate : 2018-11-28 17:34:33
         * rechType : adminAddMoney
         * account : zxcv
         * addTime : 2018-11-28 17:34:33
         * rechTime : 2018-11-28 17:34:33
         * rechMoney : 20000000.00
         * status : 2
         * remark : test
         */
        textView1.setText("交易编号：" + z_moneyDetail.bean.getOrderNo());
        textView2.setText("发起时间：" + z_moneyDetail.bean.getStatDate());
        textView3.setText("交易类型：存款");
        textView4.setText("交易金额：" + z_moneyDetail.bean.getRechMoney());
        switch (z_moneyDetail.bean.getStatus()) {
            case 1:
                textView5.setText("交易状态：未受理");
                break;
            case 2:
                textView5.setText("交易状态：充值成功");
                break;
            case 3:
                textView5.setText("交易状态：充值失败");
                break;
            case 4:
                textView5.setText("交易状态：在线充值中");
                break;
        }
//        if (z_moneyDetail.bean.getRechType().equals("bankTransfer")) {
//            textView6.setText("充值方式：" + z_moneyDetail.bean.getRechType());
//        } else {
//
//        }
//        WY********网银在线支付
//                         YLONLINE********银联快捷
//                         bankTransfer********银行卡转账
//                         ZFB********支付宝在线支付
//                         WX********微信在线支付
//                         YL********银联扫码
//                         alipay********支付宝转账
//                         weixin********微信转账
//                         cft********财付通转账
//                         JD********京东钱包
        if(z_moneyDetail.bean.getRechType().equals("onlinePayment")){
            textView6.setText("充值方式：在线支付" );
        }else {
            textView6.setText("充值方式：转账" );
        }
        textView7.setText("卡号：");
        textView8.setText("存款人：" + z_moneyDetail.bean.getUserName());
        textView9.setText("存款时间：" + z_moneyDetail.bean.getRechTime());
        cancle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        conform.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
